//
//  ListTableViewCell.m
//  UI__相册三代版
//
//  Created by dllo on 16/4/18.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "ListTableViewCell.h"

@implementation ListTableViewCell

-(void)dealloc{
    [_imageV release];
    [_nameLabel release];
    [_numberLabel release];
    [_model release];
    [super dealloc];
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self doIt];
    }
    return self;
}

-(void)doIt{
    self.nameLabel = [[UILabel alloc]init];
    self.nameLabel.backgroundColor = [UIColor redColor];
    [self.contentView addSubview:self.nameLabel];
    [_nameLabel release];

    self.numberLabel = [[UILabel alloc]init];
    self.numberLabel.backgroundColor = [UIColor cyanColor];
    [self.contentView addSubview:self.numberLabel];
    [_numberLabel release];
    
    self.imageV = [[UIImageView alloc]init];
    self.imageV.backgroundColor = [UIColor yellowColor];
    [self.contentView addSubview:self.imageV];
    [_imageV release];
}

-(void)layoutSubviews{
    [super layoutSubviews];
    self.imageV.frame = CGRectMake(10, 10, 100, 130);
    self.nameLabel.frame = CGRectMake(150, 30, 200, 30);
    self.numberLabel.frame = CGRectMake(150, 90, 200, 30);
    

}


-(void)setModel:(ListModel *)model{
    if (_model != model) {
       [_model release];
        _model = [_model retain];
}
    self.imageV.image = model.image;
    self.numberLabel.text = model.number;
    self.nameLabel.text = model.name;
 
    
    
    
}



- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
